/* GUI CONVERTED from ececrp04.p (converter v1.75) Mon Aug 14 12:26:05 2000 */
/* ececrp04.p - PCC PRINT SUB-ROUTING: ROUTING FILE REPORT                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert ececrp04.p (converter v1.00) Mon Oct 20 18:31:30 1997 */
/* web tag in ececrp04.p (converter v1.00) Mon Oct 20 18:29:32 1997 */
/*K136*/ /*                                                    */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 8.6     DATE CREATED: 03/31/97    MODIFIED BY: Joe Gawel  *K08X* */
/* REVISION: 8.6    LAST MODIFIED: 06/25/97    MODIFIED BY: Joe Gawel  *K0F4* */
/* REVISION: 8.6    LAST MODIFIED: 10/20/97    MODIFIED BY: mur        *K136* */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00 BY: *N0KW* Jacolyn Neder        */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

          {mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ececrp04_p_1 "Run Time/Batch Qty"
/* MaxLen: Comment: */

&SCOPED-DEFINE ececrp04_p_2 "Comments"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/*K136*/   {wbrp02.i}

/*K0F4*  THE INCLUDE FILES USED FOR THIS PATCH (ECRODEF.I, ECROGET.I    */
/*K0F4*  AND ECROPUT.I) SHOULD BE REMOVED ONCE THE NEW FIELDS HAVE BEEN */
/*K0F4*  ADDED TO THE ECD2_DET TABLE IN THE SCHEMA.                     */

/*K0F4*/  {ecrodef.i}  /* ECD2_DET SIDEFILE DEFINITIONS */

          define shared variable ecmnbr like ecm_nbr.
          define variable comments      like mfc_logical
                                        label {&ececrp04_p_2} no-undo.
          define variable ecd2routing   like ecd2_routing no-undo.
          define variable ecd2op        like ecd2_op no-undo.
/*K0F4*/  define variable batch_qty        like pt_batch no-undo.
/*K0F4*/  define variable um               like bom_batch_um no-undo.
/*K0F4*/  define variable runtime_per_batch like ro_run
/*K0F4*/                  label {&ececrp04_p_1}
/*K0F4*/                  format ">>>>>>>>9.9<<<<<<<<" no-undo.

          FORM /*GUI*/ 
          
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
{ecform15.i}
          with frame form15 attr-space side-labels width 80 overlay NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-form15-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame form15 = F-form15-title.
 RECT-FRAME-LABEL:HIDDEN in frame form15 = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame form15 =
  FRAME form15:HEIGHT-PIXELS - RECT-FRAME:Y in frame form15 - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME form15 = FRAME form15:WIDTH-CHARS - .5.  /*GUI*/


          /* SET EXTERNAL LABELS */
          setFrameLabels(frame form15:handle).

          find ecm_mstr where ecm_nbr = ecmnbr no-lock no-error.
          if not available (ecm_mstr) then return.

/*K0F4*/  if can-find(first ecd2_det where ecd2_nbr = ecm_nbr) then page.

          for each ecd2_det no-lock where ecd2_nbr = ecm_nbr
          by ecd2_routing by ecd2_op on endkey undo, return with frame form15:
            find first pt_mstr where pt_part = ecd2_routing no-lock no-error.
            if available pt_mstr then display pt_desc1 with frame form15 STREAM-IO /*GUI*/ .
            else display "" @ pt_desc1 with frame form15 STREAM-IO /*GUI*/ .
            find first wc_mstr where wc_wkctr = ecd2_wkctr and wc_mch = ecd2_mch
            no-lock no-error.
            if available wc_mstr then display wc_desc with frame form15 STREAM-IO /*GUI*/ .
            else display "" @ wc_desc with frame form15 STREAM-IO /*GUI*/ .

/*K0F4*/    {ecroget.i &nbr=ecd2_nbr
                       &routing=ecd2_routing
                       &op=ecd2_op
                       &lock=no-lock}

/*K0F4*/    batch_qty = 0.
/*K0F4*/    um = "".

/*K0F4*/    find bom_mstr no-lock where bom_parent = ecd2_routing no-error.
/*K0F4*/    if available bom_mstr then do:
/*K0F4*/       batch_qty = bom_batch.
/*K0F4*/       um = bom_batch_um.
/*K0F4*/    end.
/*K0F4*/    else do:
/*K0F4*/        find pt_mstr where pt_part = ecd2_routing no-lock
/*K0F4*/             no-error.
/*K0F4*/        if available pt_mstr then do:
/*K0F4*/           if pt_bom_code = ""
/*K0F4*/              then
/*K0F4*/                 find bom_mstr no-lock where bom_parent = pt_part
/*K0F4*/                      no-error.
/*K0F4*/              else
/*K0F4*/                 find bom_mstr no-lock
/*K0F4*/                      where bom_parent = pt_bom_code
/*K0F4*/                      no-error.
/*K0F4*/           if available bom_mstr then do:
/*K0F4*/              batch_qty = bom_batch.
/*K0F4*/              um = bom_batch_um.
/*K0F4*/           end.
/*K0F4*/           else do:
/*K0F4*/              um = pt_um.
/*K0F4*/           end.
/*K0F4*/        end.
/*K0F4*/     end.

/*!K0F4**** REPLACED FOLLOWING DISPLAY ****
 *          display
 *             ecd2_routing @ ecd2routing
 *             ecd2_op @ ecd2op
 *             ecd2_desc
 *             ecd2_std_op
 *             ecd2_wkctr
 *             ecd2_mch_op
 *             ecd2_men_mch
 *             edcd2_batch
 *             ecd2_run_per_b
 *             ecd2_subcntrt
 *             ecd2_sub_cost
 *             ecd2_setup_men
 *             ecd2_yield_pct
 *             ecd2_setup
 *             ecd2_run
 *             ecd2_tool
 *             ecd2_vend
 *             ecd2__qad01
 *             (if ecd2_cmtindx <> 0 then yes else no) @ comments
 *          with frame form15.
 *!K0F4*** END OF REPLACED DISPLAY ***/
/*K0F4**** NEW DISPLAY ****/
            display
              ecd2_routing @ ecd2routing
              ecd2_op @ ecd2op
              batch_qty
              um
              ecd2__qad01
              ecd2_std_op
              ecd2_wkctr
              ecd2_mch
              ecd2_desc
              ecd2_mch_op
              ecd2_milestone
              ecd2_tran_qty
              ecd2_sub_lead
              ecd2_queue
              ecd2_setup_men
              ecd2_wait
              ecd2_men_mch
              ecd2_setup
              ecd2_tool
              ecd2_run * batch_qty @ runtime_per_batch
              ecd2_run
              ecd2_vend
              ecd2_move
              ecd2_inv_value
              ecd2_yield_pct
              ecd2_sub_cost
              (if ecd2_cmtindx <> 0 then yes else no) @ comments
            with frame form15 STREAM-IO /*GUI*/ .
/*K0F4*** END OF NEW DISPLAY ****/

            down.
            
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

          end.
/*K136*/ {wbrp04.i}
